package net.paoding.rose.jade.properties;

import net.paoding.rose.jade.constant.JadeConstant;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import java.time.Duration;

/**
 * @author zhangfusheng
 * @date 2024/3/23
 */
@Component
@ConfigurationProperties("jade.config")
public class RoseJadeProperties {

    /**
     * 是否启用jexl3 解析器
     */
    private boolean useJexl3Interpreter;

    /**
     * 集合遍历时,索引的变量名称
     */
    private String indexVariableKey = JadeConstant.CONNECTION_INDEX_FLAG;

    /**
     * cache expire After Access,default 10 minutes
     */
    private Duration duration = Duration.ofMinutes(10L);

    public Duration getDuration() {
        return duration;
    }

    public void setDuration(Duration duration) {
        this.duration = duration;
    }

    public boolean isUseJexl3Interpreter() {
        return useJexl3Interpreter;
    }

    public void setUseJexl3Interpreter(boolean useJexl3Interpreter) {
        this.useJexl3Interpreter = useJexl3Interpreter;
    }

    public String getIndexVariableKey() {
        return indexVariableKey;
    }

    public void setIndexVariableKey(String indexVariableKey) {
        this.indexVariableKey = indexVariableKey;
    }
}

